package com.cyt.wx.model.po;

import com.cyt.base.util.BaseUtil;
import com.cyt.base.util.DictCode;
import com.cyt.sys.model.po.SysUser;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;

/**
 * 微信管理-应用菜单实体类
 *
 * @author shengQiang Yu
 * @date 2019-8-9 10:22:14
 */
@Data
@NoArgsConstructor
@Table(name = "cyt_wx_apply_menu")
public class WxApplyMenu implements Serializable {

	/**
     * 主键
     */ 
	@Id
	private String id;

	/**
     * 应用id
     */ 
	@Column(name = "apply_use_id")
	private String applyUseId;

	/**
     * 菜单图标
     */ 
	@Column(name = "menu_icon")
	private String menuIcon;

	/**
     * 菜单名称
     */ 
	@Column(name = "menu_name")
	private String menuName;

	/**
     * 菜单类型
     */ 
	@Column(name = "menu_type")
	private String menuType;

	/**
     * 权限
     */ 
	@Column(name = "permission")
	private String permission;

	/**
     * 菜单级别
     */ 
	@Column(name = "menu_grade")
	private Integer menuGrade;

	/**
     * 菜单连接
     */ 
	@Column(name = "menu_url")
	private String menuUrl;

	/**
     * 父级id
     */ 
	@Column(name = "parent_id")
	private String parentId;

	/**
     * 排序
     */ 
	@Column(name = "sort")
	private Integer sort;

	/**
     * 创建时间
     */ 
	@Column(name = "create_time")
	private Date createTime;

	/**
     * 删除标识 1、正常 2、删除
     */ 
	@Column(name = "remove_tag")
	private String removeTag;

	/**
     * 创建人
     */ 
	@Column(name = "create_user")
	private String createUser;

	/**
     * 修改人
     */ 
	@Column(name = "update_user")
	private String updateUser;

	/**
     * 修改时间
     */ 
	@Column(name = "update_time")
	private Date updateTime;
	/**
	 * 父菜单名称
	 */
	@Transient
	private String parentName;
	/**
	 * 用户应用id
	 */
	@Transient
	private String applyId;
	/**
	 * 创建对象
	 *
	 * @param sysUser 当前用户信息
	 * @author shengQiang Yu
	 * @date 2019-8-9 10:22:14
	 */
	public WxApplyMenu(SysUser sysUser) {
		this.id = BaseUtil.uId();
		this.removeTag = DictCode.BASE_REMOVE_TAG_NORMAL;
		this.createTime = new Date();
		this.createUser = sysUser.getId();
		this.updateTime = new Date();
		this.updateUser = sysUser.getId();
	}
}